import { Auth } from '@/common/decorator/auth.decorator'
import { User } from '@/common/decorator/user.decorator'
import { Body, Controller, Get, Post } from '@nestjs/common'
import { User as UserType } from '@prisma/client'
import { updateUserDto } from './dto/userInfo.dto'
import { UserService } from './user.service'

@Controller('user')
export class UserController {
  constructor(private readonly userService: UserService) {}
  @Post('/update')
  @Auth()
  getUserInfo(@User() user: UserType, @Body() userData: updateUserDto) {
    return this.userService.updateUserInfo(user.id, userData)
  }
}
